package product.server;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;

@EnableEurekaClient
@EnableFeignClients({"product-api"})
@ServletComponentScan
@SpringBootApplication
public class ProductServerApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(
                ProductServerApplication.class).run(args);
        // 写入PID
        context.addApplicationListener(new ApplicationPidFileWriter());
        System.out.println("ヾ(◍°∇°◍)ﾉﾞ大浪商城商品中心服务启动成功ヾ(◍°∇°◍)ﾉﾞ");
    }

}
